/*
* Valentine Gladstein
* SOLAR ID 108731583
* Homework #1
* CSE214
* Recitation 03-Phil Ammirato 
* Grading TA:Phil Ammirato 
*/

import java.io.*;
import java.util.*;

// The User class represents a user's account

public class User {

    //The following variables store information about the individual user:

    private String username;
    private String password;
    private String email;
    private String name;
 
/**
 * Returns an instance of the User object with place holder values for all variables.
 */
    public User() {
	username = "default";
	password = "qwerty";
	email = "johndoe@email.com";
	name = "John Doe";
    }

/**
 * Returns an instance of the User object, with user-specified values for all variables.
 *
 * @param inUsername  The User object's desired username
 * @param inPassword  The User object's desired password
 * @param inName      The User object's desired name
 * @param inEmail     The User object's desired email
 */

    public User(String inUsername, String inPassword, String inName, String inEmail) {
	username = inUsername;
	password = inPassword;
	name = inName;
	email = inEmail;
    }

/**
 * Returns a String representation of the User object
 * @return a formatted String representing the User object.
 */

    public String toString() {
	String result = String.format("%-25s%-24s%-35s%-25s", username, password, email, name);
	return result;
    }


/**
 * Compares two user objects for equality
 *
 * @param   input The user object to compare the current User object to
 * @return  boolean bvalue representing true if the objects are equal, false otherwise.
 */
    public boolean equals(User input) {
	if (!username.equals(input.getUsername()))
	    return false;
	if (!password.equals(input.getPassword()))
            return false;
	if (!email.equals(input.getEmail()))
            return false;
	if (!name.equals(input.getName()))
            return false;
	return true;
    }
   
/**
 * Accessor method for changing the User object's username parameter 
 *
 * @param input The String to which the User's username should be set
 */
 
    public void setUsername(String input) {
	username = input;
    }


/**
 * Accessor method for getting  the User object's username parameter 
 *
 * @return String reresenting the User's username
 */
    public String getUsername() {
	return username;
    }


/**
 * Accessor method for changing the User object's password parameter 
 *
 * @param input The String to which the User's password should be set
 */
    public void setPassword(String input) {
	password = input;
    }


/**
 * Accessor method for getting  the User object's password parameter 
 *
 * @return String reresenting the User's password
 */
    public String getPassword() {
	return password;
    }

/**
 * Accessor method for changing the User object's email parameter 
 *
 * @param input The String to which the User's email should be set
 */
    public void setEmail(String input) {
	email = input;
    }


/**
 * Accessor method for getting  the User object's email parameter 
 *
 * @return String reresenting the User's email
 */
    public String getEmail() {
	return email;
    }

/**
 * Accessor method for changing the User object's name parameter 
 *
 * @param input The String to which the User's name should be set
 */

    public void setName(String input) {
	name= input;
    }


/**
 * Accessor method for getting  the User object's name parameter 
 *
 * @return String reresenting the User's name
 */
    public String getName() {
	return name;
    }
}

